<?php

//Coded by Jonathan Gorard, 2012
//Part of The Matrix Unplugged, All Rights Reserved
  
	global $db,$c,$ir, $set;
	$hc=$set['hospital_count'];
	$jc=$set['jail_count'];
	$ec=$ir['new_events'];
	$mc=$ir['new_mail'];
	
	if($ir['hospital']){
		print "<a href='hospital.php'>Reconstruction ($hc)</a><br />
  <a href='inventory.php'>Inventory</a><br />";
	}

	elseif($ir['jail']){
		print "<a href='jail.php'>Jail ($jc)</a><br />
  <a href='inventory.php'>Inventory</a><br />";
	} else{
		print "<a href='index.php'>Home</a><br />
  <a href='inventory.php'>Inventory</a><br />";
	}

	
	if($ec > 0) {
		print "<a href='events.php' style='font-weight: 800;'><font color='red'>Events ($ec)</font></a><br />";
	} else {
		print "<a href='events.php'>Events (0)</a><br />";
	}

	
	if($mc > 0) {
		print "<a href='mailbox.php' style='font-weight: 800;'><font color='red'>Mailbox ($mc)</font></a><br />";
	} else {
		print "<a href='mailbox.php'>Mailbox (0)</a><br />";
	}

	
	if($ir['jail'] and !$ir['hospital']){
		print "</font><hr /><a href='training.php'><b>Training</b></a><br />
  <a href='hospital.php'>Reconstruction ($hc)</a><br />";
	} else
	if (!$ir['hospital']){
		print "</font><hr /><a href='explore.php'><b><font color='red'><font size='4'>Explore</font></font></b></a><br />
  <a href='training.php'><b><font color='lightgreen'>Training</font></b></a><br />
  <a href='missions.php'><b><font color='lightblue'>Missions</font></b></a><br />
  <a href='education.php'><b><font color='orange'>Training Programs</font></b></a><br />
  <a href='hospital.php'>Reconstruction ($hc)</a><br />
  <a href='jail.php'>Jail ($jc)</a><br />";
	} else{
		print "</font><hr /><a href='jail.php'>Jail ($jc)</a><br />";
	}

	
	if($ir['new_announcements']){
		print "<a href='announcements.php' style='font-weight: 800;'><font color='red'>Development Blog ({$ir['new_announcements']}

	)</font></a><br />";
} else{
	print "<a href='announcements.php'>Development Blog (0)</a><br />";
}

print "
<a href='forums.php'><font color='pink'><b>In-Game Forums</b></font></i></a><br />
<a href='search.php'>Search</a><br />";

if(!$ir['jail'] && $ir['gang']){
	print "<a href='yourgang.php'>Your Gang</a><br />";
}


if($ir['user_level'] > 1){
	print "<hr />
<a href='staff.php'>Staff Panel</a><br />\n";
	print "<hr /><b>Staff Online:</b><br />";
	$q=$db->query("SELECT * FROM users WHERE laston>(unix_timestamp()-15*60) AND user_level>1 ORDER BY userid ASC");
	while($r=$db->fetch_row($q)){
		$la=time()-$r['laston'];
		$unit="secs";
		
		if($la >= 60){
			$la=(int) ($la/60);
			$unit="mins";
		}

		
		if($la >= 60){
			$la=(int) ($la/60);
			$unit="hours";
			
			if($la >= 24){
				$la=(int) ($la/24);
				$unit="days";
			}

		}

		print "<a href='viewuser.php?u={$r['userid']}

	'>{$r['username']}

</a> ($la $unit)<br />";
}

}


if($ir['donatordays']){
	print "<hr />
<b>Donators Only</b><br />
<a href='friendslist.php'>Friends List</a><br />
<a href='blacklist.php'>Black List</a>";
}

print "<hr />
<b><a href='helptutorial.php'><font color='lightgreen'>Help Tutorial</font></a></b><br />
<a href='userlist.php'>User List</a><br />
<a href='preferences.php'>Preferences</a><br />
<a href='preport.php'>Player Report</a><br />
<a href='viewuser.php?u={$ir['userid']}

'>My Profile</a><br />
<a href='logout.php'><font color='yellow'><b>Jack Out (Logout)</b></font></a><br /><br />
Time is now<br />
";
echo date ('F j, Y')."<br />".date('g:i:s a');
?>
